import { ref } from 'vue'
import type PageModal from '@/components/page-modal/page-modal.vue'

export const usePageModal = () => {
  const newUserModelRef = ref<InstanceType<typeof PageModal>>()
  function userNewModelShow() {
    newUserModelRef.value?.changeDialogVisible()
  }
  function userEditModalShow(itemData: any) {
    newUserModelRef.value?.changeDialogVisible(false, itemData)
  }

  return {
    newUserModelRef,
    userNewModelShow,
    userEditModalShow
  }
}
